#include <baker/HitState.h>
#include <unittest++/UnitTest++.h>

using namespace baker;

SUITE( TestHitState )
{
    HitInfo makeHitInfo( real dist )
    {
        HitInfo hit;

        hit.dist = dist;

        return hit;
    }

    TEST( getClosestHitIndex )
    {
        HitState state;

        HitInfo * info;

        info = &state.appendHitInfo();
        info->dist = 10.0f;

        info = &state.appendHitInfo();
        info->dist = 5.0f;

        info = &state.appendHitInfo();
        info->dist = 15.0f;

        CHECK( state.getClosestHitIndex() == 1 );
    }
}
